<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>政工信息管理</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
    <link rel="stylesheet" th:href="@{/api/css/jquery.pagination.css}">
    <script th:src="@{/api/js/jquery.pagination.min.js}"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">

    <!-- header -->
    <div th:replace="~{commons/header::header}"></div>

    <!-- left -->
    <div th:replace="~{commons/left::left}"></div>
    <!-- 内容主体区域 -->
    <div class="layui-body">
        <form class="form-horizontal" id="form_table" action="/upload" enctype="multipart/form-data" method="post" style="float:left;">
            <button type="submit" class="layui-btn layui-btn-normal" style="float:left;"><i class="layui-icon layui-icon-upload-drag"></i>导入</button>
            <input class="form-input" type="file" name="filename">
        </form>
        <button type="button" class="layui-btn"><i class="layui-icon layui-icon-download-circle"></i><a href="/downloadsExcelDown" style="color: white;">导出全部数据</a></button>

        <div style="padding: 15px;">
            <table  class="table table-bordered" style="height: 360px;">
                <tr>
                    <td>职工号</td>
                    <td>姓名</td>
                    <td>政治面貌</td>
                    <td>所在学院</td>
                    <td>职务</td>
                    <td>工作状态</td>
                    <td>操作</td>
                </tr>
                <tr th:each="staff:${staff_list}">
                    <td th:text="${staff.getStaNum()}"></td>
                    <td th:text="${staff.getStaName()}"></td>
                    <td th:text="${staff.getStaPoliticalOutlook()}"></td>
                    <td th:text="${staff.getStaCollege()}"></td>
                    <td th:text="${staff.getStaWorkType()}"></td>
                    <td th:text="${staff.isStaWorkState()?'在职':'离职'}"></td>
                    <td style="width: 300px;">
                        <button class="layui-btn layui-btn-radius"><a style="color: white" th:href="@{'/staff_detail/'+${staff.getStaNum()}}">详情</a></button>
                        <button class="layui-btn layui-btn-radius layui-btn-normal"><a style="color: white" th:href="@{'/staff_update/'+${staff.getStaNum()}}">修改</a></button>
                        <button th:if="${staff.getUserState()==0}" class="layui-btn layui-btn-radius layui-btn-danger"><a style="color: white" th:href="@{'/user_stop/'+${staff.getStaNum()}}">禁用</a></button>
                        <button  th:if="${staff.getUserState()==1}" class="layui-btn layui-btn-radius layui-btn-warm"><a style="color: white" th:href="@{'/user_start/'+${staff.getStaNum()}}">启用</a></button>
                    </td>
                </tr>
            </table>

            <div class="modal-footer no-margin-top">
                <div class="col-md-6" style="float: left;margin-top: 15px;">
                    当前第 [[${pageInfo.pageNum}]]页,共 [[${pageInfo.pages}]] 页.一共 [[${pageInfo.total}]] 条记录
                </div>

                <ul class="pagination pull-right no-margin">
                    <li th:if="${pageInfo.hasPreviousPage}" style="float: left;margin-top: 15px;margin-left: 10px;">
                        <a th:href="'/staff_info?pageNum=1'" style="margin-left: 15px;color: #1e9fff;">首页</a>
                    </li>

                    <li class="prev" th:if="${pageInfo.hasPreviousPage}" style="float: left;margin-top: 15px;margin-left: 10px;">
                        <a th:href="'/staff_info?pageNum='+${pageInfo.prePage}" style="margin-left: 15px;color: #1e9fff;">
                            <i class="ace-icon fa fa-angle-double-left">上一页</i>
                        </a>
                    </li>
                    <!--遍历条数-->
                    <li th:each="nav:${pageInfo.navigatepageNums}" style="float: left;margin-top: 15px;margin-left: 10px;">
                        <a th:href="'/staff_info?pageNum='+${nav}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}"
                           style="margin-left: 15px;color: #1e9fff;"></a>
                        <span style="font-weight: bold;background: #6faed9;" th:if="${nav == pageInfo.pageNum}" th:text="${nav}" ></span>
                    </li>

                    <li class="next" th:if="${pageInfo.hasNextPage}" style="float: left;margin-top: 15px;margin-left: 10px;">
                        <a th:href="'/staff_info?pageNum='+${pageInfo.nextPage}" style="margin-left: 15px;color: #1e9fff;">
                            <i class="ace-icon fa fa-angle-double-right">下一页</i>
                        </a>
                    </li>

                    <li style="float: left;margin-top: 15px;margin-left: 10px;">
                        <a th:href="'/staff_info?pageNum='+${pageInfo.pages}" style="margin-left: 15px;color: #1e9fff;">尾页</a>
                    </li>
                </ul>
            </div>

        </div>
    </div>
</div>
<script th:src="@{/layui/layui.js}"></script>
<script>

    //JavaScript代码区域
    layui.use('element', function() {
        var element = layui.element;
    });

</script>
</body>
</html>